﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RiskMan.Providers.QuikIO
{
    
    public delegate void QuiksStatusEventHandler ( String msgError, String name, bool isConnect, object sender );
    public delegate void QuiksTransEventHandler ( object error, int tid, double orderId, string msgError );
    public delegate void QuiksTransEventHandlerAcc(object error, int tid, double orderId, string msgError, string acc);

    public abstract class TerminalsEventHandlers
    {
        public event QuiksStatusEventHandler OnTerminalsConnectionChanged;
        public event QuiksTransEventHandler OnTerminalsTransaction;
        public event QuiksTransEventHandlerAcc OnTerminalsTransactionAcc;

        public virtual void OnTerminalsConnChanged ( String msgError, String name, bool isConnect, object sender )
        {
            QuiksStatusEventHandler handler = OnTerminalsConnectionChanged;
            if ( handler != null )
            {
                handler( msgError, name, isConnect, sender );
            }
        }

        public virtual void OnTerminalsTrastation ( object error, int tid, double orderId, string msgError )
        {
            QuiksTransEventHandler handler = OnTerminalsTransaction;
            if ( handler != null )
            {
                handler( error, tid, orderId, msgError );
            }
        }

        public virtual void OnTerminalsTranstationAcc(object error, int tid, double orderId, string msgError, string acc)
        {
            QuiksTransEventHandlerAcc handler = OnTerminalsTransactionAcc;
            if (handler != null)
            {
                handler(error, tid, orderId, msgError, acc);
            }
        }
    }
}
